package com.elcl.util;

import com.elcl.andbaselibrary.R;
import com.elcl.widget.comp.dialog.LoadingProgressDialog;
import com.elcl.storage.ApplicationCache;

/**
 * Created by lichunlin on 17/1/3.
 */
public class BaseDialogUtils {


    public static LoadingProgressDialog dialog;

    public static void showProgressDialog(String... content) {
//        if (null == dialog) {
        dialog = new LoadingProgressDialog(ApplicationCache.context, R.style.MyDialog);
//        }
        if (null == content || content.length == 0) {
            dialog.show();
            dialog.setContent("正在载入...");
        } else if (content.length == 1) {
            dialog.show();
            dialog.setContent(content[0]);
        } else {
            dialog.show();
            dialog.setContent(content[1]);
        }
    }

    public static void dismissProgressDialog() {
        if (null != dialog) {
            dialog.dismiss();
        }
    }


}
